package com.handbook;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;


public class FastSafeFail {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("1");
        list.add("2");
        list.add("3");
        for(String l:list){
            System.out.println(list.remove(l));//并发修改异常
        }
        HashMap<String, Integer> map = new HashMap<>();
        map.put("s",2);
        ConcurrentHashMap<String, Integer> concurrentHashMap = new ConcurrentHashMap<>();
        concurrentHashMap.put("12",12);

    }
}
